home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
BUS
/
TMCM Software and Labs.sit
/
Software for TMCM 7_95
/
Files for Lab 13
/
Bugs
< prev
next >
Wrap
Text File
|
1995-07-07
|
695b
|
23 lines
{
A very simple application of multitasking.
Several turtles are created, and each one
engages in a random walk. (It looks sort of
like a bunch of bugs wandering randomly
around on the screen.)
You will have to stop this program using the
"Kill Program" command in the "Run" menu.
}
PenUp { You might want to remove this PenUp command;
then the "bugs" will leave "trails." }
fork(10) { Creates 10 turtles; you might want
to try increasing the number of
turtles. }
LOOP
face( randomInt(360) ) { face in a random direction }
forward( randomInt(10) / 10 ) { go forward a random amount }
EXIT IF 1=2 { loop will never end }
END LOOP